<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont back-icon">&#xe658;</span>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe63c;</span>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{this.city}}
        <span class="iconfont arrow-icon">&#xe65c;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
  // 引用全部变量表里的样式
  @import '~styles/variables.styl'
  .header
    display flex
    line-height $headerHeight
    background $bgColor
    color #fff
    .header-left
      width 32px
      float left
      .back-icon
        display block
        text-align center
        font-size 30px
    .header-input
      flex 1
      height 32px
      line-height 32px
      margin 6px 0 0 10px
      padding-left 10px
      color #ccc
      background-color #fff
      border-radius 5px
    .header-right
      min-width 50px
      padding 0 5px
      float right
      text-align center
      color #fff
      .arrow-icon
        display block
        float right
        margin 2px 0 0 0
        height 39px
        font-size 23px
</style>
